package com.yijianonghu.controller.app.user;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yijianonghu.util.Constants.AppConstants;
import com.yijianonghu.util.result.Result;

@Controller
public class ForgetPasswordController {

	/**
	 * 请求的地址 [sys_web_service]client_verify
	 * 总的流程应该是：先验证用户名，再申请和验证随机码，最后调用重设密码
	 * @param username
	 * @return
	 * 形如：<br/>
	 * { "success":true, "msg":"操作成功！", "infor":null }
	 */
	@RequestMapping(value=AppConstants.APP_PREFIX+AppConstants.APP_GENERAL_VERSION_REGX+"/client_verify", method=RequestMethod.POST)
	public @ResponseBody Result verifyClient(String username){
		//TODO 验证用户
		return null;
	}
	
	/**
	 * 请求的地址 [sys_web_service]password_reset
	 * @param temp_token
	 * @param keytype
	 * @param new_password
	 * @return
	 */
	@RequestMapping(value=AppConstants.APP_PREFIX+AppConstants.APP_GENERAL_VERSION_REGX+"/password_reset", method=RequestMethod.POST)
	public @ResponseBody Result resetPassword(String temp_token, String keytype, String new_password){
		//TODO 重设密码
		return null;
	}
}
